﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="testThumnail.aspx.cs" Inherits="testThumnail" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
     <form id="form1" runat="server">
    <div>
        Choose a image file to resize:<br />
        <asp:HiddenField ID="tbxPhotoUrl" Value="Avatar.jpg" runat="server" />
        <asp:FileUpload ID="fulPhoto" Width="300px" size="30" runat="server" />
        <asp:Button ID="btnUploadPhoto" OnClick="btnUploadPhoto_Click" runat="server" Text="Upload" />
        <br />
        <img id="imgAvatar" /> 
        <br />
        Width: 100px X Height: 75px
    </div>
    <script type="text/javascript">
        function previewImgAvatar(){
            var imgSrc = document.getElementById('<%=tbxPhotoUrl.ClientID%>').value;
            document.getElementById('imgAvatar').src = imgSrc + '?' + Math.random();
        }
        window.setTimeout("previewImgAvatar()",200);
    </script>
    </form>
</body>
</html>
